import { nextTick, onMounted, onActivated } from 'vue';
export const useMountedAndActivated = (fn: () => void, immediate = true) => {
    let mounted = false;
    onMounted(() => {
        immediate && fn();
        nextTick(() => {
            mounted = true;
        });
    });
    onActivated(() => {
        mounted && fn();
    });
};